#pragma once
#include "SpaceEntity.h"
#include "ItemType.h"
#include "Toggle.h"
class Item:public SpaceEntity
{

public:
	int itemType;
	Toggle *ticker;
	bool hasTicker;
	MaterialPtr materialPtr;
	Item(void)
	{
		isAlive=false;
		hasTicker=false;
		rotateAxis=Vector3::ZERO;
		materialPtr.setNull();
	}

	~Item(void)
	{

		CommonTool::DestroyAllAttachedMovableObjects(node);
		node->removeAndDestroyAllChildren();
		node->getParentSceneNode()->removeAndDestroyChild(node->getName());

		if (!materialPtr.isNull())
			MaterialManager::getSingletonPtr()->remove(materialPtr->getName());

		if (hasTicker)
		{
			ticker->isAlive=false;
		}
		
		
	}

	

};